#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  replacehello.py
#       Author @  Huoty
#  Create date @  2015-06-27 23:55:08
#  Description @  
# *************************************************************

import os

# Script starts from here

fo_src = open("test.txt")
fo_dest = open("a2.txt", "w")

for line in fo_src:
    fo_dest.write(line.replace("hello", "hi"))

fo_src.close()
fo_dest.close()

os.system("cat a2.txt")
